<template>
  <aplayer class="pla" :audio="audio" :showLrc="true" :shuffle="true"/>
</template>

<script>
import Vue from 'vue'
import APlayer from '@moefe/vue-aplayer'
import {dirMusicList} from "../api/website";

Vue.use(APlayer, {
  defaultCover: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSy_130iiorSSjF1RWgNBX7qy3evKv2HKsH0g&usqp=CAU',
  productionTip: true,
});
export default {
  name: "mk-aplayer",
  data() {
    return {
      audio: [
        {
          name: "修炼爱情",
          artist: "林俊杰",
          url:
            "http://localhost:8888/song/%E6%9E%97%E4%BF%8A%E6%9D%B0-%E4%BF%AE%E7%82%BC%E7%88%B1%E6%83%85.mp3",
          cover: 'http://localhost:8888/img/songPic/1649383661178l.jpg', // prettier-ignore
          lrc:
            "[[00:00.28]修炼爱情 - 林俊杰\n" +
            "[00:16.85]凭什么要失望 藏眼泪到心脏\n" +
            "[00:28.75]往事不会说谎别跟它为难\n" +
            "[00:35.83]我们两人之间不需要这样\n" +
            "[00:43.16]我想\n" +
            "[00:46.05]修炼爱情的心酸\n" +
            "[00:49.57]学会放好以前的渴望\n" +
            "[00:53.59]我们那些信仰 要忘记多难\n" +
            "[01:00.24]远距离的欣赏 近距离的迷惘\n" +
            "[01:03.88]谁说太阳会找到月亮\n" +
            "[01:07.90]别人有的爱 我们不可能模仿\n" +
            "[01:14.64]修炼爱情的悲欢\n" +
            "[01:18.06]我们这些努力不简单\n" +
            "[01:22.03]快乐炼成泪水 是一种勇敢\n" +
            "[01:28.76]几年前的幻想 几年后的原谅\n" +
            "[01:32.38]为一张脸去养一身伤\n" +
            "[01:36.24]别讲想念我 我会受不了这样\n" +
            "[01:45.50]记忆它真嚣张 路灯把痛点亮\n" +
            "[01:57.72]情人一起看过多少次月亮\n" +
            "[02:04.76]它在天空看过多少次遗忘\n" +
            "[02:11.49]多少心慌\n" +
            "[02:14.96]修炼爱情的心酸\n" +
            "[02:18.49]学会放好以前的渴望\n" +
            "[02:22.46]我们那些信仰 要忘记多难\n" +
            "[02:29.10]远距离的欣赏 近距离的迷惘\n" +
            "[02:32.78]谁说太阳会找到月亮\n" +
            "[02:36.85]别人有的爱 我们不可能模仿\n" +
            "[02:43.42]修炼爱情的悲欢\n" +
            "[02:46.89]我们这些努力不简单\n" +
            "[02:51.00]快乐炼成泪水 是一种勇敢\n" +
            "[02:57.62]几年前的幻想 几年后的原谅\n" +
            "[03:01.17]为一张脸去养一身伤\n" +
            "[03:05.28]别讲想念我 我会受不了这样\n" +
            "[03:23.40]笑着说爱让人疯狂\n" +
            "[03:26.96]哭着说爱让人坚强\n" +
            "[03:30.45]忘不了那个人就投降\n" +
            "[03:38.52]修炼爱情的悲欢\n" +
            "[03:42.04]我们这些努力不简单\n" +
            "[03:46.02]快乐炼成泪水 是一种勇敢\n" +
            "[03:52.68]几年前的幻想 几年后的原谅\n" +
            "[03:56.23]为一张脸去养一身伤\n" +
            "[04:00.15]别讲想念我 我会受不了这样\n" +
            "[04:06.85]几年前的幻想 几年后的原谅\n" +
            "[04:10.53]为一张脸去养一身伤\n" +
            "[04:14.54]别讲想念我 我会受不了这样]",
        }
      ],
    };
  },
  created() {
    this.getDataList()
  },
  methods: {
    getDataList() {
      dirMusicList().then(res => {
        let temp = res.data
        for (const re of temp) {
          re.artist = re.author
          this.audio.push(re)
        }
      })
    }
  }
}
</script>

<style scoped>
.pla {
  /*width: 100%;*/
  max-width: 700px;
  /*min-width: 375px;*/
  margin: 10px auto;
  border-radius: 5px
}
</style>
